{% extends "templates/atnet_open_base.html" %}

{% block csslink %}
		{{ super() }}
<script src="/media/js/jquery.js"></script>

{% include 'templates/includes_jquery_ui.html' %}
{% endblock %}

{% block title %} 
	{{ title }}
{% endblock %}

{% block header %}
{{ header }}
{% endblock %}

{% block login%}
{% if show_login %}
{{ super() }}
{% endif %}
{% endblock%}

{% block navigation %}
{% if not show_login %}
{{ super() }}
{% endif %}
{% endblock %}

{% block content_header %}
{{ content_header }}
{% endblock %}

{% block  main_content %}
<p>
{{ main_content }}
<form action="" method="POST">
	<fieldset>
			<div class="div-table-row">
				<div class="div-table-col-header">
				</div>
				<div class="div-table-col">
					<div class="ok">{{ ok_message }}</div>
				</div>
			</div>
		{% if person %}
			<div class="div-table-row">
				<div class="div-table-col-header">
				</div>
				<div class="div-table-col">
					{{ person }}
				</div>
			</div>
		{% endif %}
		{% for field in form %}
			<div class="div-table-row">
				<div class="div-table-col-header">
					{{ field.label.text }}{% if "required" in field.flags %}<div class="error" style="display: inline;">*</div>{% endif %}:
				</div>
				<div class="div-table-col">
					{{ field }}
					{% if field.errors %}
						{% for error in field.errors %}
							<li class="error">{{error}}</li>
						{% endfor %}
					{% endif %}
				</div>
			</div>
		{% endfor %}
	<input type="submit" value=" Save data & continue ">
	</fieldset>
</form>
</p>
{% if app_user %}
<script>
$(function() {
	var user_lang = "{{ app_user.lang }}";
	if (user_lang == "en") { user_lang = "en-GB"};
	$.datepicker.setDefaults( $.datepicker.regional[ user_lang ] );
	
	$("#bulding_completion_date").live("focus", function() {
	    $(this).datepicker({
	        inline: true,
	    });
	});
	$("#building_cert_date").live("focus", function() {
	    $(this).datepicker({
	        inline: true,
	    });
	});
	$("#building_permit_date").live("focus", function() {
	    $(this).datepicker({
	        inline: true,
	    });
	});
});
</script>
{% endif %}
{% endblock %}
